<%--
  Created by IntelliJ IDEA.
  User: zhong
  Date: 2020/5/9
  Time: 20:59
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="/manage/inc/header"/>
<jsp:include page="/manage/inc/menu"/>
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="<%=path%>/manage/index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">行业信息管理</span></div>
    </div>
    <div class="search-wrap">
        <div class="search-content">
            <form action="#" method="post">
                <table class="search-tab">
                    <tr>
                        <th width="70">关键字:</th>
                        <td><input class="common-text" placeholder="关键字" name="name" value="" id="name" type="text"></td>
                        <td><input class="btn btn-primary btn2" name="sub" value="查询" type="button" id="search"></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
    <div class="result-wrap">
        <div class="result-title">
            <div class="result-list">
                <a href="${pageContext.request.contextPath}/manage/industry/insert">添加行业</a>
            </div>
        </div>

        <div class="result-content">

        </div>

    </div>
</div>
</div>
<!--/main-->
</div>
<jsp:include page="/manage/inc/footer"/>
<script>
    var path = "${pageContext.request.contextPath}";
    $(function() {
        initData(1,"");
        $("#search").click(function () {
            var name = $.trim($("#name").val());
            initData(1,name);
        });
        $(".result-content").on("click",".list-page a",function(){
            //页码
            var pageNum = $(this).html();
            var name = $("#name").val();
            initData(pageNum,name);
            return false;
        });
    });
    function initData(pageNum,name) {
        var data = {
            name:name,pageNum:pageNum
        }
        $.get(path+"/manage/industry/industryListData",data,function (data) {
            $(".result-content").html(data);
        });
    }
</script>
